package cn.iocoder.yudao.module.wms.dal.mysql.rdrecord32;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.wms.controller.admin.rdrecord10.vo.Rdrecord10SaveReqVO;
import cn.iocoder.yudao.module.wms.controller.admin.rdrecord10.vo.Rdrecords10RespVO;
import cn.iocoder.yudao.module.wms.dal.dataobject.rdrecord10.Rdrecord10DO;
import cn.iocoder.yudao.module.wms.dal.dataobject.rdrecord32.Rdrecord32DO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wms.controller.admin.rdrecord32.vo.*;

/**
 * 销售出库主 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface Rdrecord32Mapper extends BaseMapperX<Rdrecord32DO> {

    default PageResult<Rdrecord32DO> selectPage(Rdrecord32PageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<Rdrecord32DO>()
                .eqIfPresent(Rdrecord32DO::getSerialNumber, reqVO.getSerialNumber())
                .eqIfPresent(Rdrecord32DO::getPersonId, reqVO.getPersonId())
                .eqIfPresent(Rdrecord32DO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(Rdrecord32DO::getWarehouseId, reqVO.getWarehouseId())
                .betweenIfPresent(Rdrecord32DO::getOrderDate, reqVO.getOrderDate())
                .eqIfPresent(Rdrecord32DO::getRemark, reqVO.getRemark())
                .betweenIfPresent(Rdrecord32DO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(Rdrecord32DO::getSaleOrderId, reqVO.getSaleOrderId())
                .eqIfPresent(Rdrecord32DO::getStatus, reqVO.getStatus())
                .orderByDesc(Rdrecord32DO::getId));
    }

    void updateRdrecord32Status(Rdrecord32SaveReqVO reqVO);

    Rdrecord32DO findByProcessInstanceId(String processInstanceId);
    int findCountByCode(String code);
    List<Rdrecords10RespVO> findRdrecords32ByPid(Integer pid);

}